package com.workstudy.wstudy.service.impl;

import java.util.List;
import com.workstudy.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.workstudy.wstudy.mapper.WstRecordMapper;
import com.workstudy.wstudy.domain.WstRecord;
import com.workstudy.wstudy.service.IWstRecordService;
import com.workstudy.common.core.text.Convert;

/**
 * 审核记录Service业务层处理
 * 
 * @author sun
 * @date 2021-04-04
 */
@Service
public class WstRecordServiceImpl implements IWstRecordService 
{
    @Autowired
    private WstRecordMapper wstRecordMapper;

    /**
     * 查询审核记录
     * 
     * @param id 审核记录ID
     * @return 审核记录
     */
    @Override
    public WstRecord selectWstRecordById(Long id)
    {
        return wstRecordMapper.selectWstRecordById(id);
    }

    /**
     * 查询审核记录列表
     * 
     * @param wstRecord 审核记录
     * @return 审核记录
     */
    @Override
    public List<WstRecord> selectWstRecordList(WstRecord wstRecord)
    {
        return wstRecordMapper.selectWstRecordList(wstRecord);
    }

    /**
     * 新增审核记录
     * 
     * @param wstRecord 审核记录
     * @return 结果
     */
    @Override
    public int insertWstRecord(WstRecord wstRecord)
    {
        wstRecord.setCreateTime(DateUtils.getNowDate());
        return wstRecordMapper.insertWstRecord(wstRecord);
    }

    /**
     * 修改审核记录
     * 
     * @param wstRecord 审核记录
     * @return 结果
     */
    @Override
    public int updateWstRecord(WstRecord wstRecord)
    {
        wstRecord.setUpdateTime(DateUtils.getNowDate());
        return wstRecordMapper.updateWstRecord(wstRecord);
    }

    /**
     * 删除审核记录对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteWstRecordByIds(String ids)
    {
        return wstRecordMapper.deleteWstRecordByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除审核记录信息
     * 
     * @param id 审核记录ID
     * @return 结果
     */
    @Override
    public int deleteWstRecordById(Long id)
    {
        return wstRecordMapper.deleteWstRecordById(id);
    }
}
